package com.macro.mall.common.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
@ConfigurationProperties(prefix = "xhs.api")
public class XhsApiConfig {
    private String baseUrl ;
    private String sandboxBaseUrl ;
    private boolean useSandbox = false; // 默认使用生产环境

    // 必填配置（无默认值）
    private String appId;
    private String accessToken;

    public String getEffectiveBaseUrl() {
        return useSandbox ? sandboxBaseUrl : baseUrl;
    }
}
